<template>
  <div class="goods-wrapper">
    <!-- 把for循环遍历出来的每个商品数据传给子组件 -->
    <goods-list-item
      :key="index"
      v-for="(item, index) in goodsList"
      :goodsItem="item"
    ></goods-list-item>
  </div>
</template>

<script>
import GoodsListItem from "./GoodsListItem";
export default {
  name: "GoodList",
  components: {
    GoodsListItem,
  },
  props: {
    // 传入所有goods-list-item数组集合
    goodsList: {},
  },
};
</script>

<style scoped lang='less'>
.goods-wrapper {
  display: flex;
  flex-wrap: wrap;
  padding: 10px 0;
  justify-content: space-around;
}
</style>
